package com.bum.api.processor.ghep;

import org.apache.commons.lang.StringUtils;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.service.process.ApiProcess;
import com.bum.api.processor.ghep.bo.GhepHtmlBO;

public class GhepHtmlProcess extends ApiProcess {
	GhepHtmlBO	ghepHtmlBO;

	enum Func {
		ten;
		public static Func val(String val) {
			try {
				return valueOf(val);
			} catch (Exception e) {
				return null;
			}
		}
	}

	@Override
	public String process(String path, Params params, Metas metas) {
		String[] parts = StringUtils.split(path, "/", 3);
		switch (Func.valueOf(parts[1])) {
			case ten:
				return ghepHtmlBO.ghepTen(parts.length == 3 ? parts[2] : null, params, metas);
		}
		
		return super.process(path, params, metas);
	}

	public void setGhepHtmlBO(GhepHtmlBO ghepHtmlBO) {
		this.ghepHtmlBO = ghepHtmlBO;
	}
}
